<?php

/**
 * GlOrderState form base class.
 *
 * @method GlOrderState getObject() Returns the current form's model object
 *
 * @package    GREEN_LIGHT
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseGlOrderStateForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'order_state_id' => new sfWidgetFormInputHidden(),
      'send_email'     => new sfWidgetFormInputCheckbox(),
      'color'          => new sfWidgetFormInputCheckbox(),
      'name'           => new sfWidgetFormTextarea(),
      'value'          => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'order_state_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('order_state_id')), 'empty_value' => $this->getObject()->get('order_state_id'), 'required' => false)),
      'send_email'     => new sfValidatorBoolean(array('required' => false)),
      'color'          => new sfValidatorBoolean(array('required' => false)),
      'name'           => new sfValidatorString(array('required' => false)),
      'value'          => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('gl_order_state[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'GlOrderState';
  }

}
